<?php

function zCart_pntables()
{
    // Initialise table array
    $pntable = array();

    // Table name
    $zcart_cartitems = DBUtil::getLimitedTablename('zcart_cartitems');

    $pntable['zcart_cartitems'] = $zcart_cartitems;
    $pntable['zcart_cartitems_column'] = array (
					'cartitem_id'		=>	'pn_cartitem_id',
                                      	'user_id'		=>	'pn_user_id',
                                      	'item_id'		=>	'pn_item_id',
                                      	'cartitem_weight'	=>	'pn_cartitem_weight',
                                      	'size_id'		=>	'pn_size_id',
                                      	'cartitem_quantity'	=>	'pn_cartitem_quantity',
					'cartitem_date'		=>	'pn_cartitem_date');

    $pntable['zcart_cartitems_column_def'] = array(
					'cartitem_id'		=>	'I NOTNULL AUTO PRIMARY',
                                        'user_id'		=>	"I NOTNULL DEFAULT '0'",
                                        'item_id'		=>	"I NOTNULL DEFAULT '0'",
                                        'cartitem_weight'	=>	"I NOTNULL DEFAULT '0'",
                                        'size_id'		=>	"I NOTNULL DEFAULT '0'",
                                        'cartitem_quantity'	=>	"I NOTNULL DEFAULT '0'",
					'cartitem_date'		=>	"T NOTNULL DEFAULT '1970-01-01 00:00:00'");


    // Table name
    $zcart_categories = DBUtil::getLimitedTablename('zcart_categories');

    $pntable['zcart_categories'] = $zcart_categories;
    $pntable['zcart_categories_column'] = array (
                                        'category_id'           	=>      'pn_category_id',
                                        'category_data'         	=>      'pn_category_data',
                                        'category_parent'       	=>      'pn_category_parent',
                                        'category_visible'      	=>      'pn_category_visible',
                                        'vat_id'                	=>      'pn_vat_id',
                                        'category_intro_template_id'	=>      'pn_category_intro_template_id',
                                        'category_list_template_id'	=>      'pn_category_list_template_id',
					'category_view_template_id'	=>	'pn_category_view_template_id');

    $pntable['zcart_categories_column_def'] = array(
                                        'category_id'           	=>      'I NOTNULL AUTO PRIMARY',
                                        'category_data'         	=>      "C(100) NOTNULL DEFAULT ''",
                                        'category_parent'       	=>      "I NOTNULL DEFAULT '0'",
                                        'category_visible'      	=>      "I(1) NOTNULL DEFAULT '1'",
                                        'vat_id'                	=>      "I NOTNULL DEFAULT '0'",
                                        'category_intro_template_id'    =>      "I NOTNULL DEFAULT '0'",
                                        'category_list_template_id'   	=>      "I NOTNULL DEFAULT '0'",
					'category_view_template_id'     =>	"I NOTNULL DEFAULT '0'");



    // Table name
    $zcart_invoices = DBUtil::getLimitedTablename('zcart_invoices');

    $pntable['zcart_invoices'] = $zcart_invoices;
    $pntable['zcart_invoices_column'] = array (
                                        'invoice_id'                    =>      'pn_invoice_id',
                                        'user_id'                 	=>      'pn_user_id',
                                        'invoice_type'                  =>      'pn_invoice_type',
                                        'invoice_content'               =>      'pn_invoice_content');

    $pntable['zcart_invoices_column_def'] = array(
                                        'invoice_id'                    =>      'I NOTNULL AUTO PRIMARY',
                                        'user_id'	                =>      "I NOTNULL DEFAULT '0'",
                                        'invoice_type'               	=>      "I(1) NOTNULL DEFAULT '0'",
                                        'invoice_content'               =>      'XL NOTNULL');



    // Table name
    $zcart_items = DBUtil::getLimitedTablename('zcart_items');

    $pntable['zcart_items'] = $zcart_items;
    $pntable['zcart_items_column'] = array (
                                        'item_id'                    =>      'pn_item_id',
                                        'item_sku'                 	=>      'pn_item_sku',
                                        'item_name'                  =>      'pn_item_name',
                                        'item_description'               =>      'pn_item_description',
					'item_price'			=>	'pn_item_price',
					'item_cost'			=>	'pn_item_cost',
					'category_id'			=>	'pn_category_id',
					'item_quantity'			=>	'pn_item_quantity',
					'item_ordered'			=>	'pn_item_ordered',
					'item_resale'			=>	'pn_item_resale',
					'item_weight'			=>	'pn_item_weight',
					'vat_id'			=>	'pn_vat_id',
					'scheme_id'			=>	'pn_scheme_id',
					'supplier_id'			=>	'pn_supplier_id');

    $pntable['zcart_items_column_def'] = array(
                                        'item_id'                    =>      'I NOTNULL AUTO PRIMARY',
                                        'item_sku'                 	=>      "C(25) NOTNULL DEFAULT ''",
                                        'item_name'                  =>      "C(100) NOTNULL DEFAULT ''",
                                        'item_description'               =>      'X NOTNULL',
					'item_price'			=>	"N(8.2) NOTNULL DEFAULT '0'",
					'item_cost'			=>	"N(8.2) NOTNULL DEFAULT '0'",
					'category_id'			=>	"I NOTNULL DEFAULT '0'",
					'item_quantity'			=>	"I NOTNULL DEFAULT '0'",
					'item_ordered'			=>	"I NOTNULL DEFAULT '0'",
					'item_resale'			=>	"I(1) NOTNULL DEFAULT '0'",
					'item_weight'			=>	"N(8.3) NOTNULL DEFAULT '0'",
					'vat_id'			=>	"I NOTNULL DEFAULT '0'",
					'scheme_id'			=>	"I NOTNULL DEFAULT '0'",
					'supplier_id'			=>	"I NOTNULL DEFAULT '0'");



    // Table name
    $zcart_logs = DBUtil::getLimitedTablename('zcart_logs');

    $pntable['zcart_logs'] = $zcart_logs;
    $pntable['zcart_logs_column'] = array (
                                        'log_id'                    =>      'pn_log_id',
                                        'log_timestamp'                	=>      'pn_log_timestamp',
                                        'log_ip'                  =>      'pn_log_ip',
                                        'log_username'               =>      'pn_log_username',
					'log_level'			=>	'pn_log_level',
					'log_text'			=>	'pn_log_text');

    $pntable['zcart_logs_column_def'] = array(
                                        'log_id'			=>	'I NOTNULL AUTO PRIMARY',
                                        'log_timestamp'			=>      "T NOTNULL DEFAULT '1970-01-01 00:00:00'",
                                        'log_ip'			=>      "I(20) NOTNULL DEFAULT '0'",
                                        'log_username'			=>      "C(100) NOTNULL DEFAULT ''",
					'log_level'			=>	"I(1) NOTNULL DEFAULT '0'",
					'log_text'			=>	"C(255) NOTNULL DEFAULT ''");


    // Table name
    $zcart_orders = DBUtil::getLimitedTablename('zcart_orders');

    $pntable['zcart_orders'] = $zcart_orders;
    $pntable['zcart_orders_column'] = array (
                                        'order_id'                    =>      'pn_order_id',
                                        'user_id'                	=>      'pn_user_id',
                                        'order_ctime'                  =>      'pn_order_ctime',
                                        'order_mtime'               =>      'pn_order_mtime',
					'order_cartdata'			=>	'pn_order_cartdata',
					'order_address'			=>	'pn_order_address',
					'order_ship_address'		=>	'pn_order_ship_address',
					'order_status'			=>	'pn_order_status');

    $pntable['zcart_orders_column_def'] = array(
                                        'order_id'                    =>      'I NOTNULL AUTO PRIMARY',
                                        'user_id'                	=>      "I NOTNULL DEFAULT '0'",
                                        'order_ctime'                  =>      "I(20) NOTNULL DEFAULT '0'",
                                        'order_mtime'               =>      "I(20) NOTNULL DEFAULT '0'",
					'order_cartdata'		=>	'XL NOTNULL',
					'order_address'			=>	'XL NOTNULL',
					'order_ship_address'		=>	'XL NOTNULL',
					'order_status'			=>	"I(4) NOTNULL DEFAULT '0'");


    // Table name
    $zcart_properties = DBUtil::getLimitedTablename('zcart_properties');

    $pntable['zcart_properties'] = $zcart_properties;
    $pntable['zcart_properties_column'] = array (
                                        'property_id'                    =>      'pn_property_id',
                                        'scheme_id'                	=>      'pn_scheme_id',
                                        'property_timestamp'                  =>      'pn_property_timestamp',
                                        'property_name'               =>      'pn_property_name',
					'property_type'			=>	'pn_property_type',
					'property_config'			=>	'pn_property_config',
					'property_hidden'		=>	'pn_property_hidden',
					'property_order'			=>	'pn_property_order');

    $pntable['zcart_properties_column_def'] = array(
                                        'property_id'			=>      'I NOTNULL AUTO PRIMARY',
                                        'scheme_id'			=>      "I NOTNULL DEFAULT '0'",
                                        'property_timestamp'		=>      "I(20) NOTNULL DEFAULT '0'",
                                        'property_name'			=>      "C(255) NOTNULL DEFAULT ''",
					'property_type'			=>	"C(50) NOTNULL DEFAULT ''",
					'property_config'		=>	'X NOTNULL',
					'property_hidden'		=>	"I(1) NOTNULL DEFAULT '0'",
					'property_order'		=>	"I(4) NOTNULL DEFAULT '1000'");



    // Table name
    $zcart_propertiesdata = DBUtil::getLimitedTablename('zcart_propertiesdata');

    $pntable['zcart_propertiesdata'] = $zcart_propertiesdata;
    $pntable['zcart_propertiesdata_column'] = array (
                                        'propertydata_id'		=>	'pn_propertydata_id',
                                        'property_id'			=>	'pn_property_id',
                                        'object_id'			=>	'pn_object_id',
                                        'object_type'			=>	'pn_object_type',
					'propertydata_integer'		=>	'pn_propertydata_integer',
					'propertydata_string'		=>	'pn_propertydata_string',
					'propertydata_longtext'		=>	'pn_propertydata_longtext');

    $pntable['zcart_propertiesdata_column_def'] = array(
                                        'propertydata_id'		=>      'I NOTNULL AUTO PRIMARY',
                                        'property_id'			=>      "I NOTNULL DEFAULT '0'",
                                        'object_id'			=>      "I(20) NOTNULL DEFAULT '0'",
                                        'object_type'			=>      "I(2) NOTNULL DEFAULT '0'",
					'propertydata_integer'		=>	"I(11) NOTNULL DEFAULT '0'",
					'propertydata_string'		=>	"C(255) NOTNULL DEFAULT ''",
					'propertydata_longtext'		=>	"XL NOTNULL");



    // Table name
    $zcart_schemes = DBUtil::getLimitedTablename('zcart_schemes');

    $pntable['zcart_schemes'] = $zcart_schemes;
    $pntable['zcart_schemes_column'] = array (
                                        'scheme_id'			=>	'pn_scheme_id',
                                        'template_id'			=>	'pn_template_id',
                                        'scheme_timestamp'		=>	'pn_scheme_timestamp',
                                        'scheme_name'			=>	'pn_scheme_name',
					'scheme_type'			=>	'pn_scheme_type',
					'scheme_description'		=>	'pn_scheme_description');

    $pntable['zcart_schemes_column_def'] = array(
                                        'schemes_id'			=>      'I NOTNULL AUTO PRIMARY',
                                        'template_id'			=>      "I NOTNULL DEFAULT '0'",
                                        'scheme_timestamp'		=>      "I(20) NOTNULL DEFAULT '0'",
                                        'scheme_name'			=>      "C(255) NOTNULL DEFAULT ''",
					'scheme_type'			=>	"I(2) NOTNULL DEFAULT '0'",
					'scheme_description'		=>	"C(255) NOTNULL DEFAULT ''");



    // Table name
    $zcart_suppliers = DBUtil::getLimitedTablename('zcart_suppliers');

    $pntable['zcart_suppliers'] = $zcart_suppliers;
    $pntable['zcart_suppliers_column'] = array (
                                        'supplier_id'			=>	'pn_supplier_id',
                                        'supplier_name'			=>	'pn_supplier_name',
                                        'supplier_address'		=>	'pn_supplier_address',
                                        'supplier_address2'		=>	'pn_supplier_address2',
                                        'supplier_city'			=>	'pn_supplier_city',
					'supplier_zipcode'		=>	'pn_supplier_zipcode',
					'supplier_state'		=>	'pn_supplier_state',
					'supplier_country'		=>	'pn_supplier_country',
					'supplier_phone'		=>	'pn_supplier_phone',
					'supplier_fax'			=>	'pn_supplier_fax',
					'supplier_email'		=>	'pn_supplier_email',
					'supplier_url'			=>	'pn_supplier_url');

    $pntable['zcart_suppliers_column_def'] = array(
                                        'supplier_id'			=>	'I NOTNULL AUTO PRIMARY',
                                        'supplier_name'			=>	"C(100) NOTNULL DEFAULT ''",
                                        'supplier_address'		=>	"C(100) NOTNULL DEFAULT ''",
                                        'supplier_address2'		=>	"C(100) NOTNULL DEFAULT ''",
                                        'supplier_city'			=>	"C(100) NOTNULL DEFAULT ''",
					'supplier_zipcode'		=>	"C(20) NOTNULL DEFAULT ''",
					'supplier_state'		=>	"C(100) NOTNULL DEFAULT ''",
					'supplier_country'		=>	"C(100) NOTNULL DEFAULT ''",
					'supplier_phone'		=>	"C(100) NOTNULL DEFAULT ''",
					'supplier_fax'			=>	"C(100) NOTNULL DEFAULT ''",
					'supplier_email'		=>	"C(100) NOTNULL DEFAULT ''",
					'supplier_url'			=>	"C(255) NOTNULL DEFAULT ''");



    // Table name
    $zcart_templates = DBUtil::getLimitedTablename('zcart_templates');

    $pntable['zcart_templates'] = $zcart_templates;
    $pntable['zcart_templates_column'] = array (
                                        'template_id'			=>	'pn_template_id',
                                        'template_type'			=>	'pn_template_type',
                                        'template_file'			=>	'pn_template_file',
                                        'template_description'		=>	'pn_template_description');

    $pntable['zcart_templates_column_def'] = array(
                                        'template_id'			=>	'I NOTNULL AUTO PRIMARY',
                                        'template_type'			=>	"I(2) NOTNULL DEFAULT '0'",
                                        'template_file'			=>	'X NOTNULL',
                                        'template_description'		=>	"C(100) NOTNULL DEFAULT ''");


    // Table name
    $zcart_users = DBUtil::getLimitedTablename('zcart_users');

    $pntable['zcart_users'] = $zcart_users;
    $pntable['zcart_users_column'] = array (
                                        'user_id'			=>	'pn_user_id',
                                        'user_name'			=>	'pn_user_name',
                                        'user_address'			=>	'pn_user_address',
                                        'user_address2'			=>	'pn_user_address2',
                                        'user_city'			=>	'pn_user_city',
					'user_zipcode'			=>	'pn_user_zipcode',
					'user_state'			=>	'pn_user_state',
					'user_country'			=>	'pn_user_country',
					'user_phone'			=>	'pn_user_phone',
					'user_phone2'			=>	'pn_user_phone2',
					'user_email'			=>	'pn_user_email',
					'user_paymethod'		=>	'pn_user_paymethod',
					'user_paymethod_data'		=>	'pn_user_paymethod_data',
					'user_shipmethod'		=>	'pn_user_shipmethod',
					'user_shipmethod_data'		=>	'pn_user_shipmethod_data',
					'user_regdate'			=>	'pn_user_regdate',
					'user_username'			=>	'pn_user_username',
					'user_member'			=>	'pn_user_member',
					'user_showitems'		=>	'pn_user_showitems',
					'user_ship_name'		=>	'pn_user_ship_name',
                                        'user_ship_address'		=>	'pn_user_ship_address',
                                        'user_ship_address2'		=>	'pn_user_ship_address2',
                                        'user_ship_city'		=>	'pn_user_ship_city',
					'user_ship_zipcode'		=>	'pn_user_ship_zipcode',
					'user_ship_state'		=>	'pn_user_ship_state',
					'user_ship_country'		=>	'pn_user_ship_country',
					'user_vatno'			=>	'pn_user_vatno',
					'user_business'			=>	'pn_user_business');

    $pntable['zcart_users_column_def'] = array(
    					'user_id'			=>	'I NOTNULL AUTO PRIMARY',
                                        'user_name'			=>	"C(100) NOTNULL DEFAULT ''",
                                        'user_address'			=>	"C(100) NOTNULL DEFAULT ''",
                                        'user_address2'			=>	"C(100) NOTNULL DEFAULT ''",
                                        'user_city'			=>	"C(100) NOTNULL DEFAULT ''",
					'user_zipcode'			=>	"C(20) NOTNULL DEFAULT ''",
					'user_state'			=>	"C(100) NOTNULL DEFAULT ''",
					'user_country'			=>	"C(100) NOTNULL DEFAULT ''",
					'user_phone'			=>	"C(100) NOTNULL DEFAULT ''",
					'user_phone2'			=>	"C(100) NOTNULL DEFAULT ''",
					'user_email'			=>	"C(100) NOTNULL DEFAULT ''",
					'user_paymethod'		=>	"C(100) NOTNULL DEFAULT ''",
					'user_paymethod_data'		=>	"C(255) NOTNULL DEFAULT ''",
					'user_shipmethod'		=>	"C(100) NOTNULL DEFAULT ''",
					'user_shipmethod_data'		=>	"C(255) NOTNULL DEFAULT ''",
					'user_regdate'			=>	"I(20) NOTNULL DEFAULT '0'",
					'user_username'			=>	"C(100) NOTNULL DEFAULT ''",
					'user_member'			=>	"I(1) NOTNULL DEFAULT '0'",
					'user_showitems'		=>	"C(4) NOTNULL DEFAULT ''",
					'user_ship_name'		=>	"C(100) NOTNULL DEFAULT ''",
                                        'user_ship_address'		=>	"C(100) NOTNULL DEFAULT ''",
                                        'user_ship_address2'		=>	"C(100) NOTNULL DEFAULT ''",
                                        'user_ship_city'		=>	"C(100) NOTNULL DEFAULT ''",
					'user_ship_zipcode'		=>	"C(20) NOTNULL DEFAULT ''",
					'user_ship_state'		=>	"C(100) NOTNULL DEFAULT ''",
					'user_ship_country'		=>	"C(100) NOTNULL DEFAULT ''",
					'user_vatno'			=>	"C(30) NOTNULL DEFAULT ''",
					'user_business'			=>	"I(1) NOTNULL DEFAULT '0'");


    return $pntable;
}

?>